<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">    
    <head>
        <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
        <meta name="generator" content="Adobe GoLive" />
        <title>XPath Evaluator Task</title>
        <link rel="stylesheet" type="text/css" href="stylesheets/antmanual.css"/>
    </head>
    <body>        
        <h2><a name="xpath">XPath Evaluator</a></h2>
        <h3>Description</h3>
        <p>
            Parses an XML file and then evaluates a set of XPath
            expressions on the XML file. The task fails if any XPath expression does not
            evaluate to &quot;true&quot;.            
        </p>
        <h3>Parameters</h3>
        <table border="1" cellpadding="2" cellspacing="0">
            <tr>
                <td valign="top"><b>Attribute</b></td>
                <td valign="top"><b>Description</b></td>
                <td align="center" valign="top"><b>Required</b></td>
            </tr>
            <tr>                
                <td valign="top">xmlfile</td>
                <td valign="top">the XML file to parse</td>
                <td valign="top" align="center">Yes</td>
            </tr>
        </table>
        <h3>Parameters specified as nested elements</h3>
        
        <h4>xpath (Required)</h4>
        <p>One or more XPaths that are evaluated on the XML file.</p>
        <table border="1" cellpadding="2" cellspacing="0">
            <tr>
                <td valign="top"><b>Attribute</b></td>
                <td valign="top"><b>Description</b></td>
                <td align="center" valign="top"><b>Required</b></td>
            </tr>
            <tr>                
                <td valign="top">expression</td>
                <td valign="top">the XPath expression to evaluate</td>
                <td valign="top" align="center">Yes</td>
            </tr>
        </table>
        
        <h4>namespace (Optional)</h4>
        <p>You can define one or more namespaces used in the XML file or the XPaths.</p>
        <table border="1" cellpadding="2" cellspacing="0">
            <tr>
                <td valign="top"><b>Attribute</b></td>
                <td valign="top"><b>Description</b></td>
                <td align="center" valign="top"><b>Required</b></td>
            </tr>
            <tr>                
                <td valign="top">uri</td>
                <td valign="top">the namespace URI</td>
                <td valign="top" align="center">Yes</td>
            </tr>
            <tr>                
                <td valign="top">prefix</td>
                <td valign="top">the namespace prefix</td>
                <td valign="top" align="center">Yes</td>
            </tr>
        </table>
        
        
        <h3>Examples</h3>        
<xmp>
<taskdef name="xpathtest" classname="se.jtech.ant.xpath.XPathEvaluatorTask" classpath="${lib.dir}/xpath-task.jar" />
<xpathtest xmlfile="${xml.file}">
    <namespace uri="http://www.w3.org/2000/05/xsv" prefix="xsv" />
    <xpath expression="/xsv:xsv/@instanceAssessed='false'" />
</xpathtest>
</xmp>
<xmp>
<taskdef name="xpathtest" classname="se.jtech.ant.xpath.XPathEvaluatorTask" classpath="${lib.dir}/xpath-task.jar" />
<xpathtest xmlfile="${xml.file}">
    <namespace uri="http://www.w3.org/2000/05/xsv" prefix="xsv" />
    <namespace uri="http://www.jtech.se/monkey" prefix="apa" />
    <xpath expression="/xsv:xsv/@instanceAssessed='false'" />
    <xpath expression="/xsv:xsv/xsv:schemaDocAttempt/@outcome='success'" />
    <xpath expression="/xsv:xsv/apa:monkey/@bananas='5'" />
</xpathtest>
</xmp>
        
        <hr/>
            <p align="center">Copyright &copy; 2006 JTech Network, Sweden. All rights
                Reserved.</p>
                
            
    </body>
</html>

